-
Notifications
You must be signed in to change notification settings - Fork 245
Update ghc 8.4.4 based tools to ghc 8.6.5 #618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Currently we do not give components a version and this is inconvenient as it means nix code that checks for a version does not work with haskell.nix components.
Although the default ghc used by haskell.nix is ghc 8.6.5 many of the tools used in haskell.nix are still built with the boot compiler ghc 8.4.4. These include * haskell-nix.cabal-install * haskell-nix.alex * haskell-nix.happy This change updates those to ghc 8.6.5 and includes materializations for the new versions. When cabal-install is built it is careful to disable materialization checks on the version of itself used during the build to avoid infinite recursion. There was a version of nix-tools built with the boot ghc which was only used when `checkMaterialization = true`. It was used for the boot versions of alex, happy and hscolour. These have been update to use the default (ghc 8.6.5) version of nix-tools and checkMaterialization is forced off when they are being used to build ghc. This means the materialization will only be checked for these when they are built independently (they are included in the test set via haskellNixRoots).
Random remark: I recommend setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand what's going on with the boot packages, but seems plausible.
overlays/bootstrap.nix
Outdated
@@ -34,7 +34,9 @@ in { | |||
compiler = | |||
let bootPkgs = with final.buildPackages; { | |||
ghc = buildPackages.haskell-nix.bootstrap.compiler.ghc844; | |||
inherit (final.haskell-nix.bootstrap.packages) alex happy hscolour; | |||
alex = final.haskell-nix.bootstrap.packages.alex-tool false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're here... should happy and alex also come from buildPackages
?
overlays/bootstrap.nix
Outdated
cabal-install = | ||
# Make sure that `cabal-install` used building `cabal-install` | ||
# always has `checkMaterialization = false` to avoid infinite | ||
# recursion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could do with some expansion: I suspect figuring out why this was a problem took you some time, worth recording so future people don't have to do that!
overlays/bootstrap.nix
Outdated
materialized = ../materialized/cabal-install; | ||
} // final.lib.optionalAttrs (!check) { | ||
checkMaterialization = false; | ||
})) // { version = "3.2.0.0"; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tacked the missing version
number on to the component as #615 is still building on hydra. It was going to be needed to work around the assert
in cabal-cabal-project-to-nix.nix
that I had to remove in the end anyway (because it was too strict and was another source of infinite recursion during checkMaterialization = true
). So we can safely remove it now anyway.
For the local stuff, shouldn't it be enough to use You may also want to use |
I'm generally not super keen on relying on |
e.g. you won't be able to do |
I did try
@cleverca22 suggested |
I guess if we forward all the local system stuff via |
Well we can set |
Hm, how about calling it Maybe we should have an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing looks obviously off.
Much nicer name. I have updated the code and made two overlays (eval-on-current and eval-on-build for use in the flake). I put
I like this idea, but perhaps this bit should be done in nixpkgs (or at least in another PR as this one is already quite big). |
Again probably not for this PR, but I find the use of I wonder if we could profit from more thoroughly separating the eval-time stuff from the build time stuff and using |
e.g. I think we could pull https://github.com/input-output-hk/haskell.nix/pull/618/files#diff-9f18a53e9ed9b1e7204e2dd3110e00e0R305 into its own file, move the dummy-ghc stuff in there, and then do |
This description has been updated to reflect all the changes now
made in this PR.
Although the default ghc used by haskell.nix is ghc 8.6.5 many of
the tools used in haskell.nix are still built with the boot compiler
ghc 8.4.4. These include
This change updates those to ghc 8.6.5 and includes materializations
for the new versions.
When cabal-install is built it is careful to disable materialization
checks on the version of itself used during the build to avoid
infinite recursion.
There was a version of nix-tools built with the boot ghc which was
only used when
checkMaterialization = true
. It was used forthe boot versions of alex, happy and hscolour. These have been update
to use the default (ghc 8.6.5) version of nix-tools and
checkMaterialization is forced off when they are being used to build
ghc. This means the materialization will only be checked for these
when they are built independently (they are included in the test set
via haskellNixRoots).
Three new arguments are added to
default.nix
:defaultCompilerNixName
if not specified "ghc865" is usedcheckMaterialization
makes it easier to switch on materialization checkssystem
defaults tobuiltins.currentSystem
This change also moves the work needed for hydra eval to the eval
system using a new
evalPackages
feature. This includes:fetchgit
runCommand
andwriteTextFile
git ls-files
incleanGit
cabal v2-configure
if we do not
cp -r
the files nix will not load them on hydra)Reduce size of
make-config-files.nix
strings by around 80%.These are unlikely to be the cause of hydra eval time memory
issues in the GB range, but were still quite large (around 10MB for the
cabal-simple
test case).There was issue causing excessive builds of the
git
package whencross compiling. Gory details are a comment in
lib/defaults.nix
but in short if you use
git
you need an extra.buildPackages
one is not enough because it depends on
gdb
and that willbe different in
buildPackages
compared tobuildPackages.buildPackages
.Adds missing materialization files for ghc 8.4.4 (only needed
when
checkMaterialization
is on because of othermaterialiazations, but good to have).